package com.shenmazong.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.github.pagehelper.PageInfo;
import com.shenmazong.pojo.TbTaskTheoryGradeDetail;
import com.shenmazong.service.TbTaskTheoryGradeDetailService;
import com.shenmazong.utils.ResultResponse;
import com.shenmazong.vo.ListParamVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 理论作业成绩明细
 */
@RequestMapping("/theoryGradeDetail")
@RestController
public class TbTaskTheoryGradeDetailController {
    @Autowired
    TbTaskTheoryGradeDetailService tbTaskTheoryGradeDetailService;

    /**
     * 列表
     * @param listParamVo
     * @return
     */
    @PostMapping("/findTaskTheoryGradeDetailList")
    public ResultResponse findTaskTheoryGradeDetailList(@RequestBody ListParamVo listParamVo){
        Integer current = listParamVo.getCurrent();
        Integer size = listParamVo.getSize();
        Object theoryGradeDetail = listParamVo.getParamMap().get("theoryGradeDetail");
        PageInfo pageInfo=tbTaskTheoryGradeDetailService.findTaskTheoryGradeDetailList(current,size,theoryGradeDetail);
        return ResultResponse.SUCCESS(pageInfo);
    }

    /**
     * 添加
     * @param tbTaskTheoryGradeDetail
     * @return
     */
    @PostMapping("/saveTaskTheoryGradeDetail")
    public ResultResponse saveTaskTheoryGradeDetail(@RequestBody TbTaskTheoryGradeDetail tbTaskTheoryGradeDetail){
        return tbTaskTheoryGradeDetailService.saveTaskTheoryGradeDetail(tbTaskTheoryGradeDetail);
    }

    /**
     * 回显
     * @param tbTaskTheoryGradeDetail
     * @return
     */
    @PostMapping("/echoTaskTheoryGradeDetail")
    public ResultResponse echoTaskTheoryGradeDetail(@RequestBody TbTaskTheoryGradeDetail tbTaskTheoryGradeDetail){
        return tbTaskTheoryGradeDetailService.echoTaskTheoryGradeDetail(tbTaskTheoryGradeDetail);
    }

    /**
     * 修改
     * @param tbTaskTheoryGradeDetail
     * @return
     */
    @PostMapping("/updateTaskTheoryGradeDetail")
    public ResultResponse updateTaskTheoryGradeDetail(@RequestBody TbTaskTheoryGradeDetail tbTaskTheoryGradeDetail){
        return tbTaskTheoryGradeDetailService.updateTaskTheoryGradeDetail(tbTaskTheoryGradeDetail);
    }

    /**
     * 删除
     * @param tbTaskTheoryGradeDetail
     * @return
     */
    @PostMapping("/delTaskTheoryGradeDetail")
    public ResultResponse delTaskTheoryGradeDetail(@RequestBody TbTaskTheoryGradeDetail tbTaskTheoryGradeDetail){
        return tbTaskTheoryGradeDetailService.delTaskTheoryGradeDetail(tbTaskTheoryGradeDetail);
    }

}
